<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var age = 22;
        //1 number 转字符串
        age = age.toString();
        console.log(typeof age);
        //2.强制
        let hero = String(100);
        console.log(typeof hero);
        // 3prompt
        let year = prompt("输入");
        console.log(typeof year);
    </script>
</body>
</html>